package com.harmontronics.hanma.paas.paas.domain.iam.entity.valueobject;

import java.util.HashMap;
import java.util.Map;

public enum ComponentTypeEnum {

    /**
     * 数据可见性组件
     */
    DATA_VISIBILITY_PERM_COMPONENT("DATA_VISIBILITY_PERM_COMPONENT"),
    /**
     * 操作权限组件
     */
    OPERATION_PERM_COMPONENT("OPERATION_PERM_COMPONENT"),
    /**
     * 维保权限组件
     */
    MAINTENANCE_COMPONENT("MAINTENANCE_COMPONENT"),
    /**
     * 子页面组件
     */
    EMBED_PAGE_COMPONENT("EMBED_PAGE_COMPONENT"),
    /**
     * 监控组件
     */
    MONITOR_PAGE_COMPONENT("MONITOR_PAGE_COMPONENT"),
    /**
     * 工作台
     */
    WORKBENCH_PAGE_COMPONENT("WORKBENCH_PAGE_COMPONENT"),
    /**
     * 分析报表组件
     */
    ANALYZE_PAGE_COMPONENT("ANALYZE_PAGE_COMPONENT"),
    DEVICE_ORDER_COMPONENT("DEVICE_ORDER_COMPONENT"),
    CLAMP_ORDER_COMPONENT("CLAMP_ORDER_COMPONENT"),
    ;

    private String componentType;

    ComponentTypeEnum(String cType) {
        this.componentType = cType;
    }

    @Override
    public String toString() {
        return componentType;
    }

    private static Map<String, ComponentTypeEnum> map = new HashMap<String, ComponentTypeEnum>() {
        {
            put("DATA_VISIBILITY_PERM_COMPONENT", DATA_VISIBILITY_PERM_COMPONENT);
        }

        {
            put("OPERATION_PERM_COMPONENT", OPERATION_PERM_COMPONENT);
        }

        {
            put("MAINTENANCE_COMPONENT", MAINTENANCE_COMPONENT);
        }

        {
            put("EMBED_PAGE_COMPONENT", EMBED_PAGE_COMPONENT);
        }

        {
            put("MONITOR_PAGE_COMPONENT", MONITOR_PAGE_COMPONENT);
        }

        {
            put("ANALYZE_PAGE_COMPONENT", ANALYZE_PAGE_COMPONENT);
        }

        {
            put("WORKBENCH_PAGE_COMPONENT", WORKBENCH_PAGE_COMPONENT);
        }
        {
            put("DEVICE_ORDER_COMPONENT", DEVICE_ORDER_COMPONENT);
        }
        {
            put("CLAMP_ORDER_COMPONENT", CLAMP_ORDER_COMPONENT);
        }
    };

    public static ComponentTypeEnum fromString(String cType) {
        return map.get(cType);
    }
}
